package cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.controller;

import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.entity.ParticipatingConference;
import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.service.ParticipatingConferenceService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/participationConference")
public class ParticipationConferenceController {

    @Autowired
    private ParticipatingConferenceService participatingConferenceService;

    @PostMapping
    public String save(@RequestBody ParticipatingConference participatingConference) {
        return participatingConferenceService.save(participatingConference);
    }

    @PutMapping
    public String update(@RequestBody ParticipatingConference participatingConference) {
        return participatingConferenceService.update(participatingConference);
    }

    @DeleteMapping("/{participationConferenceId}")
    public String delete(@PathVariable Long participationConferenceId) {
        return participatingConferenceService.delete(participationConferenceId);
    }

    @GetMapping
    public PageInfo<ParticipatingConference> get(int pageNum, int pageSize, ParticipatingConference participatingConference) {
        return participatingConferenceService.get(pageNum, pageSize, participatingConference);
    }
}